﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TSharp.Core.TestUtil
{
    public class TestException : TSharp.Core.Exceptions.CoreException
    {
        public TestException(string msg)
            : base(msg) { }

        /// <summary>
        /// 测试时没有发生异常而返回的异常
        /// </summary>
        /// <value>
        /// The null.
        /// </value>
        public static TestException Null = new NullTestException();

        class NullTestException : TestException
        {
            public NullTestException()
                : base("测试时没有发生异常而返回的异常") { }
            public override bool Equals(object obj)
            {
                return object.ReferenceEquals(this, obj);
            }
            public override int GetHashCode()
            {
                return int.MinValue;
            }
        }
    }
}
